// g++ x.cpp -std=c++11
#include <iostream>
#include <vector>
#include "../../utils/common_ptr.h"

#ifndef CHARTYPES_HEADER_H
#define CHARTYPES_HEADER_H

#define HEXFLAGSLENGTH 256

class CharTypes
{
public:
  CharTypes();
  ~CharTypes();

  static BOOL_ptr isHex(char c);
  static BOOL_ptr isDigit(char c);
  static bool isFirstIdentifierChar(wchar_t c);

  /**
   * @return BOOL::FALSE if {@link LayoutCharacters#EOI}
   */
  static bool isWhitespace(wchar_t c);
  // static BOOL_ptr isWhitespace(char c);
  static BOOL_ptr isWhitespace(string_ptr c);

  static BOOL_ptr isIdentifierChar(wchar_t c);
  static std::wstring valueOf(wchar_t ch);

  // private:
  static BOOL_ptr hexFlags[256];
  static bool firstIdentifierFlags[256];
  static BOOL_ptr identifierFlags[256];
  static bool whitespaceFlags[256];
  static std::wstring stringCache[256];
  static BOOL_ptr __init;
  static BOOL_ptr init();
};
// typedef boost::shared_ptr<CharTypes> CharTypes_ptr;

#endif
